import Vue from 'vue'
import App from './App.vue'
import router from './router'
import HeyUI from 'heyui'
import api from './api'
import SearchFilter from './components/search-filter'
import CateFilter from './components/cate-filter.vue'
import global from './global'
import Upload from '@/components/upload'
import CategoryNet from '@/components/category-net'

Vue.prototype.$publicPath = process.env.BASE_URL
Vue.prototype.$global = global
Vue.prototype.$api = api
Vue.prototype.$imageError = (e)=>{e.target.src = 'static/nopic.jpg'}

if (process.env.NODE_ENV === "development") {
	import('../public/static/icon.css')
}else{
	require(process.env.BASE_URL + 'static/icon.css')
}

Vue.use(HeyUI)
HeyUI.config('dict.keyName', 'id')
HeyUI.config('dict.titleName', 'name')

Vue.config.productionTip = false

Vue.component('SearchFilter', SearchFilter)
Vue.component('CateFilter', CateFilter)
Vue.component('Upload', Upload)
Vue.component('CategoryNet', CategoryNet)

new Vue({
	el: '#app',
	router,
	render: h => h(App),
})
